package com.mobox.uav.persenter

import android.view.View
import android.view.animation.Animation
import com.mobox.uav.view.activity.MainActivity

/**
 * Created by ${Clei} on 2018/6/19.
 */

class MainImpl(var activity: MainActivity) : MainContract {
    /**
     * 弹出动画、
     */
    fun settingIn(v_bg: View, view: View, anim: Animation) {
        view.visibility = View.VISIBLE
        view.startAnimation(anim)
        if (v_bg.visibility != View.VISIBLE) {
            v_bg.visibility = View.VISIBLE
        }
    }

    /**
     * 设置动画推出
     */
    fun settingOut(layoutSetting: View, moreSetting: View, vbg: View, anim: Animation) {
        if (moreSetting.visibility == View.VISIBLE) {
            moreSetting.startAnimation(anim)
        } else if (layoutSetting.visibility == View.VISIBLE) {
            layoutSetting.startAnimation(anim)
            vbg.visibility = View.GONE
        }
    }
}
